package com.HelpDog.src;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.widget.TextView;




public class HelpActivity extends Activity{
	
	Context mContext;
	MyTextToSpeech mTts = null;
	TextView mTextMessage;
	
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.help);
	
		mContext = getApplicationContext();
		mTts = new MyTextToSpeech(mContext, new MyOnInitListener());
		
		mTextMessage = (TextView)findViewById(R.id.text_help_message);
		mTextMessage.setText(FS.sMainHelpMsg);
		mHandler.sendEmptyMessageDelayed(0, 500);
	}
	
	@Override
	public void onDestroy() {
		if (mTts != null) {
			mTts.stop();
			mTts.shutdown();
		}
		
		super.onDestroy();
	}
	
	Handler mHandler = new Handler() {
		public void handleMessage(Message msg) {
			switch(msg.what) {
			case 0:
				mTts.speakFlush(mTextMessage.getText().toString());
				break;
			}
		}
	};
	

}

